const { Command } = require('commander')
const { build } = require('./build')
const { serve } = require('./serve')

const program = new Command()

program
  .command('serve')
  .description('编译调试')
  .option('-c, --config [p]', '配置文件路径')
  .action(async (options) => {
    await serve(options.config)
  })

program
  .command('build')
  .description('编译构建')
  .option('-c, --config [p]', '配置文件路径')
  .action(async (options)=> {
    await build(options.config)
  })

program
  .parse(process.argv)
